<?
include('../tools/form.php');
include('../head.php');
$kode=$_GET['kode'];
$result= select_table('mst_guru', '2','kd_guru',"$kode");

while($row = mysql_fetch_array($result)){

$kd_guru=$row['kd_guru'];
$nm_guru=$row['nm_guru'];
$alamat=$row['alamat'];
$tmpt_lahir=$row['tmpt_lahir'];
$tgl_lahir=$row['tgl_lahir'];
$tgl_masuk=$row['tgl_masuk'];
$email=$row['email'];
$nohp=$row['nohp'];
$jenkel=$row['jenkel'];
$foto=$row['foto'];
$agama=$row['agama'];
$status_delete=$row['status_delete'];
}
form_buka('mst_guru_edit_submit.php');
//============================= Judul Form ========================
judul('Form Edit Mst Guru');
//============================= Isi Form ==========================
?> <table style='width:100%;' > <tr> <td> <?input(' Kd Guru','kd_guru',"value='$kd_guru' readonly='readonly'");?>
</td> <td> <?input(' Nm Guru','nm_guru',"value='$nm_guru'");?>
</td> </tr>
<tr> <td> <?input(' Alamat','alamat',"value='$alamat'");?>
</td> <td> <?input(' Tmpt Lahir','tmpt_lahir',"value='$tmpt_lahir'");?>
</td> </tr>
<tr> <td> <?kalender(' Tgl Lahir','tgl_lahir',$tgl_lahir);?>
</td> <td> <?kalender(' Tgl Masuk','tgl_masuk',$tgl_masuk);?>
</td> </tr>
<tr> <td> <?input(' Email','email',"value='$email'");?>
</td> <td> <?input(' Nohp','nohp',"value='$nohp'");?>
</td> </tr>
<tr> <td> <?  pilih_jenkel($jenkel);?>
</td> <td> <?input(' Foto','foto',"value='$foto'");?>
</td> </tr>
<tr> <td> <?  pilih_agama($agama);?>
</td> <td> 
</td> </tr>
<tr><td colspan='2' align='center' > <br> <? button('submit','Simpan','Simpan','onclick="return cek_semua()"'); button('reset','Kosong');?> </td></tr></table><? //============================= Button ============================
form_tutup(); ?> 
<script type="text/javascript">
function cek_semua()
{
  
    if($('#nm_guru').val()=="")
        {
            alert('Nama Guru Tidak Boleh Kosong');$('#nm_guru').focus();return false; 
        }
    if($('#alamat').val()=="")
        {
            alert('Alamat Tidak Boleh Kosong');$('#alamat').focus();return false; 
        }
    if($('#tmpt_lahir').val()=="")
        {
            alert('Tempat Lahir Tidak Boleh Kosong');$('#tmpt_lahir').focus();return false; 
        }
    if($('#tgl_lahir').val()=="")
        {
            alert('Tgl Lahir Tidak Boleh Kosong');$('#tgl_lahir').focus();return false; 
        }
    if($('#tgl_masuk').val()=="")
        {
            alert('Tgl Masuk Tidak Boleh Kosong');$('#tgl_daftar').focus();return false; 
        }
    
}

</script>